﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
dim urls,Page,PageSize
	PageSize=8

	dim rs,sql,i,act,id
    	act = Request.QueryString("act")      '当前页数
    	Page = Request("page")      '当前页数
    	If Page = "" Then Page = 1
   	If Not IsNumeric(Page) Then Page = 1
    	Page = CLng(Page)
    	If Page < 1 Then Page = 1
		id=Request.QueryString("id")
		if not isnumeric(id) then id=1
		if id="" then id=1
		id=clng(id)
urls=Request.QueryString("urls")
if urls="" then urls="viewinfo.asp?id="&id&""
                nidd=1000000
		if sid<>"Null" then
		conn.execute("update qingtian_info set isok=0 where [ok]=1 and [tid]=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"') and id="&id&"")
select case v
case "0"
we0="<br/>"
hr="-------------<br/>"
%>
<card title="阅读内线"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we2="</div>"
%>
<title>阅读内线</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>		
<%=qingtian.qingsav("300")%><%=dao%><b>==阅读内线==</b><%=we0%><%=hr%>  
		<%
Set Rs = Server.CreateObject("Adodb.Recordset")
if act=1 then
Sql = "select top 1 [id] from [qingtian_info]  where [ok]=1 and [tid]=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"') and id="&id&""
			Rs.Open Sql,conn,1,3
			if not (rs.bof and rs.eof)  then
				For i=1 to rs.RecordCount
					If Rs.Eof Then
						exit For
					End If

					rs.delete
					Rs.MoveNext
				Next

			end if
			Rs.close
%><%=sou%>该信件已经删除!<%=we0%><%

else	
		Sql = "select [title],[system],[nid],[time] from [qingtian_info]  where [ok]=1 and [tid]=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"')  and id="&id&""
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
                nidd=rs("nid")
		if rs("system")=1 then
%>
<%=sou%>来自:系统内线<%=we0%>
<%=we%><%=qingtian.ubb(rs("title"))%><%=we0%><%=sou%>[<%=rs("time")%>]<%=we0%>
<%else%>
<%=sou%>来自:<a href="spacev.Asp?nid=<%=rs("nid")%>&amp;sid=<%=sidd%>"><%=qingtian.name(rs("nid"))%>(ID:<%=rs("nid")%>)</a><%=we0%><%=we%>
<%=qingtian.ubb(rs("title"))%><%=we0%><%=sou%>[<%=rs("time")%>]<%=we0%>
<% if v=0 then
book="<input name=""remark"" type=""text"" size=""15"" emptyok=""true"" value="""" /><br/><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select><anchor title=""回复"">回复<go href='addinfo.asp?Action=save&amp;sead=add&amp;id="&id&"&amp;tid="&rs("nid")&"&amp;sid="&sidd&"&amp;urls=viewinfo.asp?id="&id&"' method='post'><postfield name=""content"" value=""$(remark)""/><postfield name=""face"" value=""$(face)""/></go></anchor><br/>"
elseif v=1 then
book=""&dao&"<form action=""addinfo.asp?Action=save&amp;sead=add&amp;id="&id&"&amp;tid="&rs("nid")&"&amp;sid="&sidd&"&amp;urls=viewinfo.asp?id="&id&""" method=""post""><textarea name=""content"" rows=""2""/></textarea><br/><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select><input type=""submit"" value=""回复"" /></form>"&we0&""
end if%>
<%=book%>
<%=we%><a href="viewinfo.asp?act=1&amp;id=<%=id%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>">删除</a>.<a href="addinfo.asp?eid=1&amp;id=<%=id%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>">转发</a>.<a href="liaoinfo.asp?id=<%=rs("nid")%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>">聊天模式</a><%=we0%>
<%              end if
       		else
		%><%=sou%>该信件已经删除，或没有该信件！<%=we0%><%
		end if
		Rs.close
end if
%><%=dao%><b>=最近内线记录=</b><%=we0%><%
Sql = "select [title],[nid],[tid],[time] from [qingtian_info]  where [ok]=1 and (nid=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"') and tid="&nidd&" or (tid=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"') and nid="&nidd&")) order by [time]  desc"
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
		For i=1 to 5

			If Rs.Eof Then
				exit For
			End If
dat=i
dat1=dat mod 2
if dat1=0 then
Response.Write hr&we
else
Response.Write hr&sou
end if
		if rs("nid")=nidd then
%>Ta说:<%=qingtian.ubb(rs("title"))%>[<%=rs("time")%>]<%=we0%>
<%elseif rs("tid")=nidd then%>
Wo说:<%=qingtian.ubb(rs("title"))%>[<%=rs("time")%>]<%=we0%>
<%              End If
		Rs.MoveNext
		Next
	else
		%><%=we%>你还没有任何内线记录!<%=we0%><%
	end if
	Rs.close
	set rs=nothing

		%>
<%=hr%><%=qingtian.qingsav("301")%>
<%=sou%><a href="<%=qingtian.backurl(urls)%>">返回来源页</a>|<a href="ininfo.asp?sid=<%=sidd%>">收件箱</a><%=we0%><%

		else
			Response.Redirect "/login.asp?sid=" & sidd & "url=/user/viewinfo.asp?id="&id&"@@sid="&sidd&"@@urls="&urls

		end if


end Function%>
